package com.springboot.mapper;

import com.springboot.bean.Student;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @author peter
 * @title: StudentMapper
 * @projectName springAll-peter
 * @description: TODO
 * @date 19-5-5下午4:13
 */
public class StudentMapper implements RowMapper<Student> {
    @Override
    public Student mapRow(ResultSet rs, int i) throws SQLException {
        Student student = new Student();
        student.setSno(rs.getInt("sno"));
        student.setName(rs.getString("sname"));
        student.setSex(rs.getString("ssex"));
        return student;
    }
}
